import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import Layout from '@/layout'

const routes = [
    {
        path: '/login', 
        component: () => import('@/views/login'),
        hidden:true
    },
    {
        path: '/index', 
        component: () => import('@/views/index'),
        hidden:true
    },
    {
        path:'/404',
        component:() => import('@/views/404'),
        hidden:true
    },
    {
        path: '/', 
        redirect:'/home',
        component:Layout,
        children:[
            {
                path:'home',
                name:'Home',
                component:() => import('@/views/home')
            }
        ]
    },
    {
        path: '/sys',
        component:Layout,
        children:[ 
            {
                path:'sysConfig',
                name:'SysConfig',
                component:() => import('@/views/sysConfig')
            }
        ]
    },
    {
        path: '/user',
        component:Layout,
        children:[ 
            {
                path:'userManager',
                name:'UserManager',
                component:() => import('@/views/userManager')
            }
        ]
    },
    { path: '*', redirect: '/404', hidden: true }
]

const router = new VueRouter({
    routes
})

export default router